<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
    <title>文档列表 - 光年(Light Year Admin)后台管理系统模板</title>
    <link rel="icon" href="favicon.ico" type="image/ico">
    <meta name="keywords" content="LightYear,光年,后台模板,后台管理系统,光年HTML模板">
    <meta name="description" content="LightYear是一个基于Bootstrap v3.3.7的后台管理系统的HTML模板。">
    <meta name="author" content="yinqi">
    <link href="/lib/css/bootstrap.min.css" rel="stylesheet">
    <link href="/lib/css/materialdesignicons.min.css" rel="stylesheet">
    <link href="/lib/css/style.min.css" rel="stylesheet">
</head>

<body>
<div class="container-fluid p-t-15">

    <div class="row">
        <div class="col-lg-12">
            <div class="card">
                <div class="card-toolbar clearfix">
                    <form class="pull-right search-bar" method="get" action="#!" role="form">
                        <div class="input-group">
                            <div class="input-group-btn">
                                <input type="hidden" name="search_field" id="search-field" value="title">
                                <button class="btn btn-default dropdown-toggle" id="search-btn" data-toggle="dropdown" type="button" aria-haspopup="true" aria-expanded="false">
                                    标题 <span class="caret"></span>
                                </button>
                                <ul class="dropdown-menu">
                                    <li> <a tabindex="-1" href="javascript:void(0)" data-field="title">标题</a> </li>
                                    <li> <a tabindex="-1" href="javascript:void(0)" data-field="cat_name">栏目</a> </li>
                                </ul>
                            </div>
                            <input type="text" class="form-control" value="" name="keyword" placeholder="请输入名称">
                        </div>
                    </form>
                    <div class="toolbar-btn-action">
                        <a class="btn btn-primary m-r-5" href="#!"><i class="mdi mdi-plus"></i> 新增</a>
                    </div>
                </div>
                <div class="layui-body">
                    <table id="demo" lay-filter="test"></table>
                </div>
               <!-- <div class="card-body">

                    <div class="table-responsive">
                        <table class="table table-bordered">
                            <thead>
                            <tr>
                                <th>
                                    <label class="lyear-checkbox checkbox-primary">
                                        <input type="checkbox" id="check-all"><span></span>
                                    </label>
                                </th>
                                <th>ID</th>
                                <th>产品名称</th>
                                <th>产品单价</th>
                                <th>库存数量</th>
                                <th>状态</th>
                                <th>操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            <tr>
                                <td>
                                    <label class="lyear-checkbox checkbox-primary">
                                        <input type="checkbox" name="ids[]" value="1"><span></span>
                                    </label>
                                </td>
                                <td>1</td>
                                <td>第01章 天涯思君不可忘</td>
                                <td>金庸</td>
                                <td>36</td>
                                <td><font class="text-success">正常</font></td>
                                <td>
                                    <div class="btn-group">
                                        <a class="btn btn-xs btn-default" href="#!" title="编辑" data-toggle="tooltip"><i class="mdi mdi-pencil"></i></a>
                                        <a class="btn btn-xs btn-default" href="#!" title="删除" data-toggle="tooltip"><i class="mdi mdi-window-close"></i></a>
                                    </div>
                                </td>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                    <ul class="pagination">
                        <li class="disabled"><span>«</span></li>
                        <li class="active"><span>1</span></li>
                        <li><a href="#1">2</a></li>
                        <li><a href="#1">3</a></li>
                        <li><a href="#1">4</a></li>
                        <li><a href="#1">5</a></li>
                        <li><a href="#1">6</a></li>
                        <li><a href="#1">7</a></li>
                        <li><a href="#1">8</a></li>
                        <li class="disabled"><span>...</span></li>
                        <li><a href="#!">14452</a></li>
                        <li><a href="#!">14453</a></li>
                        <li><a href="#!">»</a></li>
                    </ul>

                </div>-->
            </div>
        </div>

    </div>

</div>
<script src="/lib/layui/layui.js" charset="utf-8"></script>

<script th:inline="none">
    //JavaScript代码区域
    layui.use(['element','jquery','table','layer'], function(){
        var element = layui.element;
        var layer = layui.layer;
        var table = layui.table;
        var $ = layui.jquery;

        //第一个实例
        table.render({
            id:'demo'
            ,elem: '#demo' //目标table标签
            // ,toolbar: '#toolbarDemo'
            ,height: 312
            ,url: '/gaolist' //数据接口 ajax
            ,page: true //开启分页
            ,cols: [[ //表头,，显示的数据列。注意：：：[[ thymeleaf
                {field: 'id', title: 'ID', width:80, sort: true, fixed: 'left'}
                <#list table.fields as field>
                {field: '${field.propertyName}', title: '${field.comment}', width:100},
                </#list>
            ]]
        });

    });
</script>
<script type="text/javascript" src="/lib/js/jquery.min.js"></script>
<script type="text/javascript" src="/lib/js/bootstrap.min.js"></script>
<script type="text/javascript" src="/lib/js/main.min.js"></script>
<script type="text/javascript">
    $(function(){
        $('.search-bar .dropdown-menu a').click(function() {
            var field = $(this).data('field') || '';
            $('#search-field').val(field);
            $('#search-btn').html($(this).text() + ' <span class="caret"></span>');
        });
    });
</script>
</body>
</html>